cmake_minimum_required(VERSION 3.13)
project(websocket VERSION 1.0.0 LANGUAGES C CXX)

# This project can use C11, but will gracefully decay down to C89.
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED OFF)
set(CMAKE_C_EXTENSIONS OFF)

# This project requires C++11.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(WIN32)
    add_definitions(-DWIN32_LEAN_AND_MEAN)
    add_definitions(-DUNICODE -D_UNICODE)
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
    add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
else()
    add_definitions(-D_FILE_OFFSET_BITS=64)
endif()

aux_source_directory(${PROJECT_SOURCE_DIR}/src BASE_SRC)
add_executable(demo ${BASE_SRC})

target_include_directories(demo
PRIVATE
    ${PROJECT_SOURCE_DIR}
)
